from product_manager import ProductManager
from search_engine import SearchEngine
from user_interface import UserInterface
from data_generator import DataGenerator


def main():
    # 生成模拟数据
    data_generator = DataGenerator()
    products = data_generator.generate_products(1000)

    # 初始化产品管理器
    product_manager = ProductManager()
    for product in products:
        product_manager.add_product(product)

    # 初始化搜索引擎
    search_engine = SearchEngine(product_manager)

    # 初始化用户界面
    ui = UserInterface(search_engine)

    # 启动用户界面
    ui.start()


if __name__ == "__main__":
    main()